<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>用户明细</title>
    <style>
        th {
            text-align: center
        }

        .date.form_date {
            padding: 5px;
            width: 110px;
        }

        .date.form_date input[type="text"] {
            width: 75px;
        }

        .dataTables_wrapper {
            padding-top: 15px;
        }
    </style>
</head>
<body class="nav-md">
<!-- /top navigation -->

<!-- page content -->
<div class="">
    <!--<div class="page-title">-->
    <!--<div class="title_left">-->
    <!--<h3>-->
    <!--用户明细<small></small>-->
    <!--</h3>-->
    <!--</div>-->
    <!--</div>-->

    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h3>用户明细</h3>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <!--<p class="text-muted font-13 m-b-30">用户明细</p>-->

                    <ul id="myTab1" class="nav nav-tabs bar_tabs" role="tablist">
                        <li role="presentation" class="[#if type==0]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=0')">用户列表</a></li>
                        <li role="presentation" class="[#if type==1]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=1')">企业列表</a></li>
                        <li role="presentation" class="[#if type==2]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=2')">企业统计</a></li>
                        <li role="presentation" class="[#if type==3]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=3')">登录记录</a></li>
                        <li role="presentation" class="[#if type==4 || type==5]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=4')">活跃用户</a></li>
                        <li role="presentation" class="[#if type==6]active[/#if]"><a
                                href="javascript:void(0)"
                                onclick="pjaxContent('/user/userdetail?type=6')">平安易宝用户</a></li>
                    </ul>
                    [#if type==0 || type==1 || type==2 || type==3 || type==5 || type==6]
                    <!-- 时间 -->
                    <div style="display: inline-block;float: left;">
                        <label id="labelTimeName" style="padding-top:8px;padding-right:10px">[#if type==2 || type==5]月份[#elseif
                            type==3]登录时间[#elseif type == 1]认证时间[#else]注册时间[/#if]</label>
                        <div class="controls input-append date form_date" data-date=""
                             data-date-format="dd MM" data-link-field="dtp_input1"
                             data-link-format="yyyy-mm" style="margin-right: 3px;">
                            <span class="add-on"><i class="icon-th"></i></span> <input id="so_startTime"
                                                                                       name="so_startTime"
                                                                                       id="dtp_input1Hm1" size="16"
                                                                                       type="text"
                                                                                       value="[#if so_startTime??]${so_startTime!}[/#if]"
                                                                                       readonly>
                        </div>
                        —
                        <div class="controls input-append date form_date" data-date=""
                             data-date-format="dd MM" data-link-field="dtp_input2"
                             data-link-format="yyyy-mm">
                            <span class="add-on"><i class="icon-th"></i></span> <input id="so_endTime" name="so_endTime"
                                                                                       id="dtp_input1Hm2" size="16"
                                                                                       type="text"
                                                                                       value="[#if so_endTime??]${so_endTime!}[/#if]"
                                                                                       readonly>
                        </div>
                    </div>
                    [/#if]


                    [#if type==0 || type==1 || type==6]
                    <!-- 下拉选择 -->
                    <div class="col-xs-2">
                        <label style="padding-top:8px;float: left; margin-right: 5px;">状态</label>
                        <div class="col-xs-8" style="padding-left: 0px;">
                            <select class="form-control" name="so_select" id="so_select">
                            [#if type==0]
                            <option value=''>全部</option>
                            <option [#if so_select ?? && so_select==1]selected='selected'[/#if] value='1'>启用</option>
                            <option [#if so_select ?? && so_select==0]selected='selected'[/#if] value='0'>禁用</option>
                            [/#if]
                            [#if type==1]
                            <option value=''>全部</option>
                            <option [#if so_select ?? && so_select==0] selected='selected' [/#if] value='0'>待审核</option>
                            <option [#if so_select ?? && so_select==1] selected='selected' [/#if] value='1'>重新审核</option>
                            <option [#if so_select ?? && so_select==2] selected='selected' [/#if] value='2'>驳回</option>
                            <option [#if so_select ?? && so_select==3] selected='selected' [/#if] value='3'>审核通过</option>
                            <option [#if so_select ?? && so_select==4] selected='selected' [/#if] value='4'>禁用</option>
                            [/#if]
                            [#if type==6]
                            <option value=''>全部</option>
                            <option [#if so_select ?? && so_select==1] selected='selected' [/#if] value='1'>正常</option>
                            <option [#if so_select ?? && so_select==2] selected='selected' [/#if] value='2'>已销户</option>
                            [/#if]
                            </select>
                        </div>
                    </div>
                    [/#if]
                    [#if type == 1]
                        <div class="col-xs-2">
                            <label style="padding-top:8px;float: left; margin-right: 5px;">身份</label>
                            <div class="col-xs-8" style="padding-left: 0px;">
                                <select class="form-control" name="so_identity" id="so_identity">
                                    <option value=''>全部</option>
                                    <option [#if so_identity ?? && so_identity==1]selected='selected'[/#if] value='1'>采购商</option>
                                    <option [#if so_identity ?? && so_identity==2]selected='selected'[/#if] value='2'>供应商</option>
                                    <option [#if so_identity ?? && so_identity==3]selected='selected'[/#if] value='3'>双重身份</option>
                                </select>
                            </div>
                        </div>
                    [/#if]

                    [#if type==0 || type==1 || type == 4 || type == 6]
                    <!-- 搜索 -->
                    <div class="col-xs-2" style="padding-left: 0px;">
                        <label style="padding-top:8px;float: left;">搜索</label>
                        <div class="col-xs-9">
                            <input class="col-xs-12 form-control" name="so_search" id="so_search"
                                   value="[#if so_search??]${so_search!}[/#if]" class="form-control" type="text"
                                   placeholder="[#if type==0]手机/邮箱/公司[#elseif type==4]手机/邮箱/公司[#else]公司[/#if]">
                        </div>
                    </div>
                    [/#if]
                    [#if type ==1 ]
                    <!-- 系统搜索 -->
                    <div class="col-xs-2" style="padding-left: 0px;">
                        <label style="padding-top:8px;float: left;">系统筛选</label>
                        <div class="col-xs-6">
                            <select id="categroySelect" class="selectpicker bla bla bli" multiple data-live-search="true">
                                [#list categorys as c]
                                    <option value="${c.id!}">${c.name}</option>
                                [/#list]
                            </select>
                        </div>
                    </div>
                    [/#if]
                    <div class="col-sm-4" style="float:right">
                        <div class="form-group" style="text-align: right;">
                            <button type="button" onclick="search();" class="btn btn-primary">搜索</button>
                            [#if type!=5]
                            <button type="button" onclick="reset();" class="btn btn-danger">重置</button>
                            <button type="submit" id="exportexcel" onclick="exportexcel()" class="btn btn-success">
                                                   导出EXCEL
                            </button>
                            [/#if]
                            [#if type==5]
                            <button type="button" href="javascript:void(0)" onclick="pjaxContent('/user/userdetail?type=4')"class="btn btn-success">返回</button>
                            [/#if]
                        </div>
                    </div>
                    <input type="hidden" id="type" value="${type!}">
                    <input type="hidden" id="userId" value="${userId!}">
                    <table id="datatable" class="table table-striped table-bordered">
                        <thead>
                        [#if type==0]
                        <tr>
                            <th>用户ID</th>
                            <th>手机</th>
                            <th>邮箱</th>
                            <th>真实姓名</th>
                            <th>公司名称</th>
                            <th>采购商</th>
                            <th>供应商</th>
                            <th>用户角色</th>
                            <th>登录次数</th>
                            <th>状态</th>
                            <th>注册时间</th>
                        </tr>
                        [/#if] [#if type==1]
                        <tr>
                            <th>企业ID</th>
                            <th>企业名称</th>
                            <th>联系方式</th>
                            <th>采购商</th>
                            <th>供应商</th>
                            <th>用户数</th>
                            <th>省份</th>
                            <th>城市</th>
                            <th>审核状态</th>
                            <th>认证时间</th>
                        </tr>
                        [/#if] [#if type==2]
                        <tr>
                            <th>用户总数</th>
                            <th>公司总数</th>
                            <th>月份</th>
                        </tr>
                        [/#if] [#if type==3]
                        <tr>
                            <th>用户ID</th>
                            <th>用户名</th>
                            <th>登录时间</th>
                            <th>登录方式</th>
                            <th>IP</th>
                            <th>退出时间</th>
                        </tr>
                        [/#if]
                        [#if type==4]
                        <tr>
                            <th>用户手机</th>
                            <th>用户邮箱</th>
                            <th>所属企业</th>
                            <th>热度</th>
                            <th>明细</th>
                        </tr>
                        [/#if]
                        [#if type==5]
                        <tr>
                            <th>月份</th>
                            <th>所属企业</th>
                            <th>采购商</th>
                            <th>供应商</th>
                            <th>店铺浏览次数</th>
                            <th>用户登录次数</th>
                            <th>询价次数</th>
                            <th>报价次数</th>
                            <th>采购商订单数</th>
                            <th>供应商订单数</th>
                        </tr>
                        [/#if]
                        [#if type==6]
                        <tr>
                            <th>企业名称</th>
                            <th>会员子账号</th>
                            <th>安装通代码</th>
                            <th>可用资金</th>
                            <th>冻结资金</th>
                            <th>状态</th>
                            <th>注册时间</th>
                        </tr>
                        [/#if]
                        </thead>

                    </table>
                </div>
            </div>
        </div>

    </div>
</div>
<!-- /page content -->
[#if type == 1]
<script type="text/javascript" src="/res/vendors/bootstrap-select/bootstrap-select.js"></script>
<link rel="stylesheet" type="text/css" href="/res/vendors/bootstrap-select/bootstrap-select.css">
[/#if]
<script src="/res/handlebars/js/handlebars-v4.0.10.js"></script>
<script src="/res/build/js/user/userDataTables.js"></script>
<script id="tpl" type="text/x-handlebars-template">
{{#each func}}
    <button type="button" class="btn btn-{{this.type}} btn-sm" onclick="{{this.fn}}">{{this.name}}</button>
{{/each}}
</script>
</body>
</html>